package com.windchimes.edueval_platform.domain.dto;

import com.windchimes.edueval_platform.domain.po.JudgeQuestion;
import com.windchimes.edueval_platform.domain.po.SelectQuestion;
import com.windchimes.edueval_platform.domain.po.SolveQuestion;
import com.windchimes.edueval_platform.domain.po.FillQuestion;
import lombok.Data;

//题库Dto,用于接收前端的题目数据
//为了避免过度设计，同时也当VO，向前端传值用
@Data
public class QuestionDto {
    private SelectQuestion selectQuestion;
    private JudgeQuestion judgeQuestion;
    private FillQuestion fillQuestion;
    private SolveQuestion solveQuestion;

    private int questionType;//1选择，2判断，3填空，4解答

    // 每个 Setter 方法中自动计算 questionType

    public void setSelectQuestion(SelectQuestion selectQuestion) {
        this.selectQuestion = selectQuestion;
        this.questionType = 1; // 1=选择
    }

    public void setJudgeQuestion(JudgeQuestion judgeQuestion) {
        this.judgeQuestion = judgeQuestion;
        this.questionType = 2; // 2=判断
    }


    public void setFillQuestion(FillQuestion fillQuestion) {
        this.fillQuestion = fillQuestion;
        this.questionType = 3; // 3=填空
    }

    public void setSolveQuestion(SolveQuestion solveQuestion) {
        this.solveQuestion = solveQuestion;
        this.questionType = 4; // 4=解答
    }

}